/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entitybean;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author ShahanThai
 */
@Entity
@Table(name = "Producers", catalog = "SharingMusic", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "Producers.findAll", query = "SELECT p FROM Producers p"),
    @NamedQuery(name = "Producers.findByProducerID", query = "SELECT p FROM Producers p WHERE p.producerID = :producerID"),
    @NamedQuery(name = "Producers.findByProducerName", query = "SELECT p FROM Producers p WHERE p.producerName = :producerName")})
public class Producers implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue
    @Basic(optional = false)
    @Column(name = "ProducerID", nullable = false)
    private int producerID;
    @Basic(optional = false)
    @Column(name = "ProducerName", nullable = false, length = 50)
    private String producerName;
    @OneToMany(mappedBy = "producers")
    private List<Songs> songsList;

    public Producers() {
    }

    public Producers(int producerID) {
        this.producerID = producerID;
    }

    public Producers(int producerID, String producerName) {
        this.producerID = producerID;
        this.producerName = producerName;
    }

    public Producers(String producerName) {
        this.producerName = producerName;
    }

    public int getProducerID() {
        return producerID;
    }

    public void setProducerID(int producerID) {
        this.producerID = producerID;
    }

    public String getProducerName() {
        return producerName;
    }

    public void setProducerName(String producerName) {
        this.producerName = producerName;
    }

    public List<Songs> getSongsList() {
        return songsList;
    }

    public void setSongsList(List<Songs> songsList) {
        this.songsList = songsList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash = this.producerID;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Producers)) {
            return false;
        }
        Producers other = (Producers) object;
        if (this.producerID != other.producerID) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entitybean.Producers[producerID=" + producerID + "]";
    }

}
